
#ifndef _PathFindBehaviour_H_
#define _PathFindBehaviour_H_

#include "../Utils/Vector2D.h"
#include "../Ship.h"
#include "../WorldObject.h"
#include "../World.h"

#include <vector>

class PathRender : public WorldObject {
  public:
    PathRender(std::vector<Vector2D> path);
    ~PathRender();
 
    void render(void);
    void update(void);
    bool active(void);

    bool resolveCollision(Ship *ship);
    bool resolveCollision(Weapon *weapon);
    bool resolveCollision(Map *map);
    
    void kill(void);

  private:
    std::vector<Vector2D> path;
    bool is_active;
};

class PathFindBehaviour {
  public:
    PathFindBehaviour(Ship *my_ship, Vector2D target);
    ~PathFindBehaviour();

    bool goToTarget(void);
    Vector2D getTargetPos(void);

    bool make_valid(void);

  private:

    Ship *ship;
    Vector2D target_point;
    std::vector<Vector2D> waypoints;
    unsigned cur_waypoint;
    PathRender *my_render;
 
};

#endif

